﻿Imports System.Activities
Imports System.Data.SqlClient
Imports System.Activities.Presentation.Metadata
Imports System.ComponentModel
Imports System.Drawing
Imports System.Activities.Expressions
Imports System.Activities.Presentation.PropertyEditing

Friend Class ExportTableRecordsActivity
    Inherits MSSQLBaseActivity

    Public Property OutputFile As InArgument(Of String)
    Public Property TableName As InArgument(Of String)
    Public Property Condition As InArgument(Of String)

    Public Sub New()

    End Sub



    Public Overrides Sub Register()
        MyBase.Register()

        Dim build As New AttributeTableBuilder
        'ExportTableRecordsActivity Activity
        build.AddCustomAttributes(GetType(ExportTableRecordsActivity),
                                              New ToolboxBitmapAttribute(GetType(ExportTableRecordsActivity), "Backup.png"))
        build.AddCustomAttributes(GetType(ExportTableRecordsActivity), "OutputFile",
                                              New RequiredArgumentAttribute,
                                              New EditorAttribute(GetType(FilepathPropertyEditor), GetType(DialogPropertyValueEditor)),
                                              New CategoryAttribute(My.Resources.CategoryDetail),
                                              New DisplayNameAttribute(My.Resources.OutputTargetDisplay),
                                              New DescriptionAttribute(My.Resources.OutputTargetDescription))
        build.AddCustomAttributes(GetType(ExportTableRecordsActivity), "TableName",
                                              New RequiredArgumentAttribute,
                                              New CategoryAttribute(My.Resources.CategoryDetail),
                                              New DisplayNameAttribute(My.Resources.DatabaseNameDisplay),
                                              New DescriptionAttribute(My.Resources.DatabaseNameDescription))
        build.AddCustomAttributes(GetType(ExportTableRecordsActivity), "Condition",
                                              New CategoryAttribute(My.Resources.CategoryDetail),
                                              New DisplayNameAttribute(My.Resources.BackupTypeDisplay),
                                              New DescriptionAttribute(My.Resources.BackupTypeDescription))

        MetadataStore.AddAttributeTable(build.CreateTable)
    End Sub

End Class
